<template>
  <div>
    <h3>修改密码</h3>
    <div class="editPassword">
      <Form ref="formInline" :model="formInline">
        <FormItem prop="user">
          <Input type="text" v-model="formInline.user" placeholder="请输入旧密码" clearable>
            <Icon type="ios-lock-outline" slot="prepend"></Icon>
          </Input>
        </FormItem>
        <FormItem prop="password">
          <Input type="password" v-model="formInline.password" placeholder="请输入新密码">
            <Icon type="ios-lock-outline" slot="prepend"></Icon>
          </Input>
        </FormItem>
        <div style="position: relative;
                    float: right;
                    top: -56px;
                    left: 80px;">
          <FormItem>
            <Button type="primary" @click="handleSubmit('formInline')">确定</Button>
          </FormItem>
        </div>
      </Form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        user: "",
        password: ""
      }
    };
  },
  methods: {
    handleSubmit(name) {
      this.$refs[name].validate(valid => {
        if (valid) {
          this.$Message.success("Success!");
        } else {
          this.$Message.error("Fail!");
        }
      });
    }
  }
};
</script>
<style scoped>
.editPassword {
  margin-top: 20px;
  width: 32%;
}
</style>